﻿using delete.Common.UserControls;
using delete.ViewModels;
using Prism.Regions;
using Prism.Services.Dialogs;
using System.Windows;
using System.Windows.Input;

namespace delete.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        private readonly IRegionManager regionManager;
        public IDialogService DialogService { get; }

        public MainWindow(IRegionManager regionManager, IDialogService dialogService)
        {
            InitializeComponent();
            this.regionManager = regionManager;
            DialogService = dialogService;
            //RegionManager.SetRegionName(Ctr,"ContentRegion");
            //  regionManager.RegisterViewWithRegion("ContentRegion", typeof(ViewA));
        }
        private void CloseBtn_Click(object sender, RoutedEventArgs e)
        {
            DialogService.ShowDialog("CloseDialog", callback =>
            {
                if (callback.Result == ButtonResult.OK)
                {
                    this.Close();
                }
            });
        }

        private void dragOutLine_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                DragMove();
            }
        }

        private void MinBtn_Click(object sender, RoutedEventArgs e)
        {
            WindowState = WindowState.Minimized;
        }

        private void MaxBtn_Click(object sender, RoutedEventArgs e)
        {
            if (WindowState == WindowState.Normal)
            {
                WindowState = WindowState.Maximized;
            }
            else
            {
                WindowState = WindowState.Normal;
            }
        }
    }
}
